<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="number">
    <button>发送</button>
    <script>
        const ipt = document.querySelector('input')
        const btn = document.querySelector('button')
        let time = 10
        btn.onclick = function() {
            ipt.value = ''
            btn.innerHTML = `还剩${time}秒`
            btn.disabled = true
            const timer = setInterval(() => {
                btn.innerHTML = `还剩${--time}秒`
                if (time == 0) {
                    btn.disabled = false
                    btn.innerHTML = '发送'
                    time = 10
                    clearInterval(timer)
                }
            }, 1000);
        }
    </script>
</body>

</html>